package com.devin.service.impl;

import com.devin.model.entity.Movie;
import com.devin.repository.MovieRepository;
import com.devin.repository.base.BaseRepository;
import com.devin.service.MovieService;
import com.devin.service.base.AbstractCrudService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

/**
 *  
 *  @author devin
 *  @date 2020-04-14 19:14
 *  @version 1.0.2
*/

@Service
public class MovieServiceImpl extends AbstractCrudService<Movie, Long> implements MovieService {


    private final MovieRepository movieRepository;

    @Autowired
    protected MovieServiceImpl(BaseRepository<Movie, Long> repository, MovieRepository movieRepository) {
        super(repository);
        this.movieRepository = movieRepository;
    }


    @Override
    public Page<Movie> search(String key, Pageable pageable) {
        return this.movieRepository.search(key, pageable);
    }
}
